package com.dc.mintsdk.controller;

import com.dc.mintsdk.bean.Product;
import com.dc.mintsdk.vo.ResultVO;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 * @author xcj
 * @date 2022/5/19 9:58
 */
@RestController
public class MainController {

    @GetMapping(value = "getInit")
    @ResponseBody
    public ResultVO getInit(){

        ResultVO resultVO = new ResultVO();
        resultVO.setCode(200);
        resultVO.setMessage("这是一个初始化请求！");
//        resultVO.setData(new Product(1,"牛奶", BigDecimal.valueOf(6.111),100));
        resultVO.setData(new Product(2,"咖啡", BigDecimal.valueOf(16.211),30));
        return resultVO;
    }

}
